package test.my.com.myapplicationtest.RefreshScorllView;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;

import butterknife.Bind;
import butterknife.ButterKnife;
import test.my.com.myapplicationtest.R;

/**
 * Author : Cooper
 * Time : 2017/6/21  17:12
 * Description :
 */

public class RefreshScrollViewActivity extends Activity {

    @Bind(R.id.refresh_scrollview)
    RefreshScrollView refreshScrollview;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.aty_refresh_scrollview_layout);
        ButterKnife.bind(this);

//        refreshScrollview.setIsPullToRefresh(true);
        refreshScrollview.setPullDownListener(new RefreshScrollView.PullDownListener() {
            @Override
            public void onRefresh() {
                refreshScrollview.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        refreshScrollview.setRefreshing(false);
                    }
                },2000);
            }
        });
    }
}
